<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="http://www.scrum.org/Portals/0/favicon.ico">
<title><g:layoutTitle default="My Agile" /></title>
<r:require modules="LoadMask,jEditable,jquery, FontAwesome, MyAgileUI, Bootstrap, PlUpload,jQueryValidate" />
<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
      <script src="${resource(dir:'js', file: 'html5shiv.js')}"></script>
<![endif]-->
<r:layoutResources />
<g:layoutHead />
</head>
<body>
	<div id="wrap">
		<div class="navbar navbar-static-top">
			<div class="navbar-inner">
				<div class="container">
					<div class="navbar-left">
						<a class="brand" href="${createLink(uri: '/')}"> My Agile </a>
						<ul class="nav pull-left">
							<li class="active"><a
								href="${createLink(controller:'Team')}"><i
									class='icon-group icon-right-spacing'></i>My Team</a></li>
							<li><a
								href="${createLink(controller:'Project',action:'index')}"><i
									class='icon-folder-close icon-right-spacing'></i>My Projects</a></li>
							<li><a href="${createLink(controller:'Backlogs',action:'index')}"><i class='icon-th  icon-right-spacing'></i>Backlogs</a></li>
							<li><a
								href="${createLink(controller:'Sprint',action:'index')}"><i
									class='icon-time  icon-right-spacing'></i>Sprint</a></li>
							<li><a href="${createLink(controller:'RetrospectiveResult',action:'index')}"><i
									class='icon-comments  icon-right-spacing'></i>Meeting</a></li>
						</ul>
						<ul class="nav pull-right">
							<sec:ifLoggedIn>
								<li class="dropdown"><a id="info" href="#"
									data-toggle="dropdown" class="dropdown-toggle avatar-wrapper">
								</a>
									<ul class="dropdown-menu">
										<li><a
											href="${createLink(controller:'member',action:'update')}">Edit
												profile</a></li>
										<li><a href="#">Account settings</a></li>
										<li><a href="${createLink(controller: 'logout')}">Sign
												out</a></li>
									</ul></li>
							</sec:ifLoggedIn>
							<sec:ifNotLoggedIn>
								<li><a
									href="${createLink(controller:'login',action:'index')}">Register
										/ Sign In</a></li>
							</sec:ifNotLoggedIn>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<div class="content container">
			<g:layoutBody />
		</div>
		<div id="push"></div>
	</div>

	<div id="footer">
		<div class="container">
			<p class="pull-right text-right copyright">© Copyright 2013. AXON
				ACTIVE VIETNAM. All Rights Reserved.</p>
		</div>
	</div>
	<r:layoutResources />
	<script type="text/javascript">
		$(document).ready(function(){
			$.ajax({
				url: '${createLink(controller: 'login', action: 'findMemberByUserName')}',
				dataType: 'json',
				cache: false,
				success: function(data){
					if(data.avatar.avatar == null){
						var pathImg = '<sec:username /><img class="avatar img-circle"  src="${resource(dir : 'avatarImages/',file: 'user.png', absolute : true)}" alt="avatar"/>'
						$('#info').html(pathImg);
					}
					else {
					var pathImg = '<sec:username /><img  class="avatar img-circle"  src="${resource(dir : 'avatarImages/', absolute : true)}'+data.avatar.avatar+'"  alt="avatar"/>'
					$('#info').html(pathImg);
					}	
				}
			});

			var pathname = window.location.pathname;
			var s = pathname.slice(0, pathname.lastIndexOf("/"));
			$('li').removeClass('active');
			var li = $('a[href="'+s+'/index"]').parent();
			if(li.parent().parent().is('li'))
				li.parent().parent().addClass('active');
			else
				li.addClass('active');
		});
	</script>
</body>
</html>